/** @jsxImportSource @emotion/react */
import * as React from "react";
import {OriginalViewProps,} from "../../common/base";
import {createItem,} from "../../common/eHelper";
import {useRecordListSubr} from "../../hook/useRecordListSub";
import {ProjectListRq} from "../../vessel/editProj";
import {EntranceSetup, VsProjects默认} from "./orcBase";
import {DeviceSurveyPrf} from "../../boiler/editorDJ";
import {WaterQuality} from "./WaterQuality";
import {config设备概况, config增补概况,} from "./viewRes";
import {ConclusionOrganN} from "./Conclusion";
import {ThreeConfigRaft} from "../../gas/editor";
import {config型式试, config热载体况, TypeTestVw} from "./CarrierCondition";

const defvcbFunc = (par: any) => {
  if(!par.载品标记)  par.载品标记='L-Q    GB 23971';
  return  par;
};

const recordPrintList =[
  createItem('Entrance', <EntranceSetup/>),
  createItem('ProjectList', <ProjectListRq config={VsProjects默认}  label={'目录页'}/>),
  createItem('Survey', <ThreeConfigRaft config={config设备概况} label={'关联台账的设备概况'} adField={[]}>
      注：以上资料审查设备概况除在台账业务信息中可修改外还需修改的部分。
  </ThreeConfigRaft>),
  //兼容性：针对没有关联设备台账的情形：需要额外录入增补概况字段。 无台帐的情况rep.snapshot{服务单位，}:就无其它必须的锅炉概况字段了，自己录入。存储名字保证不变。
  createItem('SurveySupp', <DeviceSurveyPrf config={config增补概况} label={'没有关联台账的情形-单位锅炉设备概况'}/>),
  createItem('CarrierCondition', <ThreeConfigRaft config={config热载体况} label={'有机热载体情况'} defValCb={defvcbFunc}>
      注：未使用-载体情况。
  </ThreeConfigRaft>),
  createItem('TypeTest', <ThreeConfigRaft config={config型式试} label={'型式试验情况'}/>),
  createItem('Conclusion', <ConclusionOrganN label={'检验意见，下结论'}/>),
  createItem("WaterQuality", <WaterQuality label={'热载体检验项目'}/>),
  createItem('_Controller',  <></>),
];

export const OriginalView=
  React.forwardRef((
    { action: modAction,  verId, repId='', rep}
    :OriginalViewProps, ref
  ) => {
    const {list}=useRecordListSubr(ref,rep,recordPrintList,modAction,verId);
    return <React.Fragment>
      {list}
    </React.Fragment>;
  } );
